# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
#   Mayor.create(:name => 'Daley', :city => cities.first)

Enterprise.create! [ {
    :name => '海南微斯达',
    :address => '海南DC城3楼111',
    :email => 'amon.lei@21cn.com',    
    :qq => '78616848 151430712',
    :fax => '089866777777',
    :link_phone => '089831669989',
    :synopsis => '主营CPU，主板，液晶显示器，显卡 '
  },{
    :name => '海南同行网',
    :address => '半山花园海天阁1668',
    :email => 'amon.lei@gmail.com',
    :qq => '78616848 ',
    :fax => '089866777777',
    :link_phone => '089831669989',
    :synopsis => '主营CPU，主板，液晶显示器，显卡 '
  }]

User.create! [{
    :enterprise_id => Enterprise.first.id,
    :full_name => '雷宇',
    :mobile => '13976118662',
    :encrypted_password => '1234',
    :email => 'amon.lei@gmail.com',
    :status => 'active'
  },{
    :enterprise_id => Enterprise.all[1].id,
    :full_name => '雷宇',
    :mobile => '13976118662',
    :encrypted_password => '1234',
    :email => 'amon.lei@gmail.com',
    :status => 'active'
  }]
Enterprise.first.update_attributes! :admin_id => User.first
Enterprise.all[1].update_attributes! :admin_id => User.all[1]